package com.liuugoqing.creator.factory.abstracts;

import com.liuugoqing.creator.factory.method.AmericanCoffeeFactory;
import org.junit.Test;

/**
 * 测试抽象工厂
 * @Author : liugq
 * @Date : 2022/7/1 10:36
 * @See : 参考类
 * @Since： JDK1.8
 * @Version : 1.0
 */
public class TestAbstracts {
    @Test
    public void test() throws Exception{


        DessertFactory dessertFactory   = new AmericanDessertFactory();
        Coffee coffee = dessertFactory.createCoffee();
        Dessert dessert = dessertFactory.createDessert();
        dessert.show();
        System.out.println(coffee.getName());
    }
}
